package context;

import bean.PolicyDO;
import org.springframework.context.support.AbstractApplicationContext;

/**
 * 继承FactoryBean的实例化
 */
public class FactoryBeanContext {

	public static void main(String[] args) {
		AbstractApplicationContext context = new CustomerClassPathXmlApplicationContext("factory-bean.xml");
		Object bean = context.getBean("&myFactoryBean");
		PolicyDO PolicyDO1 = (PolicyDO) context.getBean("myFactoryBean");
		PolicyDO PolicyDO2 = (PolicyDO) context.getBean("myFactoryBean");
		System.out.println(PolicyDO1.equals(PolicyDO2));
	}
}
